package fun.diaoer.service;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import fun.diaoer.entity.DISysPermission;
import fun.diaoer.entity.DISysUser;
import fun.diaoer.entity.vo.VDISysUser;
import fun.diaoer.service.security.DiaoerUserDetail;

public interface AuthService {
	
	/**
	 * 获取用户id
	 * @return
	 */
	String getUserId();
	
	List<String> getRoleds();
	
	List<DISysUser> searchUsers();
	
	List<DISysPermission> getPerms();
	
	/**
	 * 查询当前用户下所有权限节点
	 * @return
	 */
	List<DISysPermission> searchPerms();
	
	/**
	 * 是否登陆
	 * @return
	 */
	boolean isLogin();
	
	String login(DiaoerUserDetail userDetail,HttpServletRequest request);
	
	/**
	 * 注册
	 * @param user
	 * @return
	 */
	boolean register(VDISysUser user); 
	
	/**
	 * 用户名是否已经存在
	 * @param userName
	 * @return
	 */
	boolean isExistUserName(String userName);
	
}
